<%--
    @Description： SPC查询
    @Author： 樊双峰
    @Date： 2018-12-17 11:43
--%>
<style type="text/css">
tr, th, td {
    text-align: center;
}
</style>
<div class="bjui-pageHeader">
    <form id="pagerForm" data-toggle="ajaxsearch" action="${SYS_QUERY_PATH}" method="post">
        <div class="bjui-searchBar">
            <g:hiddenField name="SYS_QUERY_NAME" value="${SYS_QUERY_NAME}"/>
            <g:hiddenField name="EXPORT_CONTENT_NAME" value="Excel"/>
            <label>SPC任务<strong><span class="text-danger"></span></strong>：</label>
            <g:textField name="spcName" value="${spcName}" size="17" placeholder="SPC任务"/>&nbsp;
            <label>采集项<strong><span class="text-danger"></span></strong>：</label>
            <g:textField name="itemName" value="${itemName}" size="17" placeholder="采集项"/>&nbsp;
            <button type="submit" class="btn-default" data-icon="search">查询</button>&nbsp;
            <button type="button" class="btn-blue"
                    onclick="javascript:bjuiExportExl('#pagerForm', '${request.getContextPath()}/Base/exportExcel')"
                    data-icon="file-excel-o" title="导出Excel">导出</button>
        </div>
    </form>
</div>
<div class="bjui-pageContent tableContent">
    <g:if test="${spcByJobDataList.size() > 0}">
        <table id="data" data-toggle="tablefixed" data-width="230%" data-nowrap="true">
            <thead>
            <tr>
                <th width="50">NO.</th>
                <g:each in="${spcByJobHeadList}" status="i" var="headInstance">
                    <g:if test="${headInstance != 'RN'}">
                        <g:if test="${headInstance != 'OBJECT_RRN'}">
                            <th><g:message code="${headInstance}" default="${headInstance}"/></th>
                        </g:if>
                    </g:if>
                </g:each>
            </tr>
            </thead>
            <tbody>
            <g:each in="${spcByJobDataList}" status="i" var="dataInstance">
                <tr>
                    <td>${dataInstance.RN}</td>
                    <g:each in="${spcByJobHeadList}" status="j" var="headInstance">
                        <g:if test="${headInstance != 'RN'}">
                            <g:if test="${headInstance != 'OBJECT_RRN'}">
                                <g:if test="${headInstance == '采集项'}">
                                    <td>
                                        <a href="${request.getContextPath()}/Spc/spcDetail?spcRrn=<%=dataInstance.OBJECT_RRN%>&spcName=<%=dataInstance.SPC任务%>&itemName=<%=dataInstance.采集项%>%{--&startTime=<%=params.startTime%>--}%&endTime=<%=params.endTime%>&xBarUCL=<%=dataInstance.XBAR_UCL%>&xBarCL=<%=dataInstance.XBAR_CL%>&xBarLCL=<%=dataInstance.XBAR_LCL%>&sigmaUCL=<%=dataInstance.SIGMA_UCL%>&sigmaCL=<%=dataInstance.SIGMA_CL%>&sigmaLCL=<%=dataInstance.SIGMA_LCL%>&rangeUCL=<%=dataInstance.RANGE_UCL%>&rangeCL=<%=dataInstance.RANGE_CL%>&rangeLCL=<%=dataInstance.RANGE_LCL%>" data-toggle="navtab" data-id="dialog-normal" data-options="{id:'spcDetail', title:'采集数据明细'}">
                                            ${dataInstance["${headInstance}"] }
                                        </a>
                                    </td>
                                </g:if>
                                <g:else>
                                    <td>${dataInstance["${headInstance}"]}</td>
                                </g:else>
                            </g:if>
                        </g:if>
                    </g:each>
                </tr>
            </g:each>
            </tbody>
        </table>
    </g:if>
    <g:else>
        <g:render template="../template/emptyPanel"/>
    </g:else>
</div>
<g:render template="../template/pagination" />
<script src="${request.getContextPath()}/js/sort.js"></script>
<script type="text/javascript">
    $(function () {
        $("#data").makeSortable();
    });
</script>